﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace tour.szhome.www.Controllers
{
    public class HelperController : Controller
    {
        //
        // GET: /Helper/

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 把字符串转换成ID
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        [ActionName("get_xmlb_id")]
        public ActionResult ConvertToID(string Name) 
        {
            int lid = 8;
            switch (Name)
            {
                case "滨海资源":
                    lid = 0;
                    break;
                case "温泉资源":
                    lid = 1;
                    break;
                case "湖泊资源":
                    lid = 2;
                    break;
                case "山林资源":
                    lid = 3;
                    break;
                case "高尔夫资源":
                    lid = 4;
                    break;
                case "主题公园资源":
                    lid = 5;
                    break;
                default:
                    lid = 8;
                    break;
            }
            return Json(lid, JsonRequestBehavior.AllowGet);
        }
    }
}
